home *** CD-ROM | disk | FTP | other *** search
- /* cat > headers/id.h << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* id.h: header for id.c file */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- #define id_h 1
-
- #include "all.h"
- #include "newext.h"
-
- #define SMALL_FONT "/usr/lib/fonts/fixedwidthfonts/cour.b.18"
- #define LARGE_FONT "/usr/lib/fonts/fixedwidthfonts/cour.b.24"
-
- #define ID_BG_COLOR 50
- #define ID_COLOR1 130
- #define ID_COLOR2 180
- #define ID_COLOR3 210
-
- static int width, height, xwin, ywin, ystart;
-
- /* EOF */
- /* cat > src+obj/id/make_id_symbol.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* make_id_symbol: make the id symbol */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "id.h" */
-
- make_id_symbol ()
- {
- struct pixfont *pfsmall, *pflarge;
- char str[MAXNAMELEN];
-
- width = (int) window_get (canvas, WIN_WIDTH);
- height = (int) window_get (canvas, WIN_HEIGHT);
- xwin = (int) window_get (canvas, WIN_X);
- ywin = (int) window_get (canvas, WIN_Y);
- ystart = height / 7;
-
- if ((pfsmall = pf_open (SMALL_FONT)) == NULL)
- pfsmall = pf_default ();
- if ((pflarge = pf_open (LARGE_FONT)) == NULL)
- pflarge = pf_default ();
-
- paint_bg ();
-
- strcpy (str, "The National Center for Supercomputing Applications");
- put_text (str, pfsmall, 0, ID_COLOR1);
- strcpy (str, "at the University of Illinois at Urbana-Champaign");
- put_text (str, pfsmall, 30, ID_COLOR1);
- strcpy (str, "Presents:");
- put_text (str, pfsmall, 50, ID_COLOR2);
- strcpy (str, "I M A G E T O O L");
- put_text (str, pflarge, 70, ID_COLOR2);
- strcpy (str, "Release 1.1");
- put_text (str, pfsmall, 30, ID_COLOR1);
- strcpy (str, "For the Sun Workstation (TM)");
- put_text (str, pfsmall, 30, ID_COLOR1);
-
- strcpy (str, "(Featuring NCSA HDF support)");
- put_text (str, pfsmall, 50, ID_COLOR2);
- strcpy (str, "Click on cancel button to clear canvas");
- put_text (str, pfsmall, 90, ID_COLOR3);
-
- pf_close (pfsmall);
- pf_close (pflarge);
- }
- /* EOF */
- /* cat > src+obj/id/paint_bg.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* paint_bg: paint backgournd */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "id.h" */
-
- paint_bg ()
- {
- Pixwin *pw = canvas_pixwin (canvas);
-
- pw_writebackground (pw, 0, 0, width, height,
- PIX_SRC | PIX_COLOR (ID_BG_COLOR));
- }
- /* EOF */
- /* cat > src+obj/id/put_text.c << "EOF" */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* put_text: put text */
- /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
- /* SCCS information: %W% %G% - NCSA */
-
- /* #include "id.h" */
-
- put_text (str, pf, yinc, color)
- char *str;
- /* input: string to print */
- struct pixfont *pf;
- /* input: pointer to data structure of font to use for the string */
- int yinc;
- /* input: gap in pixels between the last string and this string */
- int color;
- /* input: color to use how? */
- {
- Pixwin *pw = canvas_pixwin (canvas);
- int len = strlen (str);
- int x;
-
- x = xwin + width / 2 - pf->pf_defaultsize.x * len / 2;
- ystart += yinc;
- pw_ttext (pw, x, ystart, PIX_SRC | PIX_COLOR (color), pf, str);
- }
- /* EOF */
-